.TH "Search subsystem" 3spotify "Wed Mar 28 2012" "libspotify" \" -*- nroff -*-
.ad l
.nh
.SH NAME
Search subsystem \- 
.SS "Typedefs"

.in +1c
.ti -1c
.RI "typedef void \fBsearch_complete_cb\fP (\fBsp_search\fP *result, void *userdata)"
.br
.in -1c
.SS "Functions"

.in +1c
.ti -1c
.RI "\fBsp_search\fP * \fBsp_search_create\fP (\fBsp_session\fP *session, const char *query, int track_offset, int track_count, int album_offset, int album_count, int artist_offset, int artist_count, int playlist_offset, int playlist_count, \fBsp_search_type\fP search_type, \fBsearch_complete_cb\fP *callback, void *userdata)"
.br
.ti -1c
.RI "bool \fBsp_search_is_loaded\fP (\fBsp_search\fP *search)"
.br
.ti -1c
.RI "\fBsp_error\fP \fBsp_search_error\fP (\fBsp_search\fP *search)"
.br
.ti -1c
.RI "int \fBsp_search_num_tracks\fP (\fBsp_search\fP *search)"
.br
.ti -1c
.RI "\fBsp_track\fP * \fBsp_search_track\fP (\fBsp_search\fP *search, int index)"
.br
.ti -1c
.RI "int \fBsp_search_num_albums\fP (\fBsp_search\fP *search)"
.br
.ti -1c
.RI "\fBsp_album\fP * \fBsp_search_album\fP (\fBsp_search\fP *search, int index)"
.br
.ti -1c
.RI "int \fBsp_search_num_playlists\fP (\fBsp_search\fP *search)"
.br
.ti -1c
.RI "const char * \fBsp_search_playlist_name\fP (\fBsp_search\fP *search, int index)"
.br
.ti -1c
.RI "const char * \fBsp_search_playlist_uri\fP (\fBsp_search\fP *search, int index)"
.br
.ti -1c
.RI "const char * \fBsp_search_playlist_image_uri\fP (\fBsp_search\fP *search, int index)"
.br
.ti -1c
.RI "int \fBsp_search_num_artists\fP (\fBsp_search\fP *search)"
.br
.ti -1c
.RI "\fBsp_artist\fP * \fBsp_search_artist\fP (\fBsp_search\fP *search, int index)"
.br
.ti -1c
.RI "const char * \fBsp_search_query\fP (\fBsp_search\fP *search)"
.br
.ti -1c
.RI "const char * \fBsp_search_did_you_mean\fP (\fBsp_search\fP *search)"
.br
.ti -1c
.RI "int \fBsp_search_total_tracks\fP (\fBsp_search\fP *search)"
.br
.ti -1c
.RI "int \fBsp_search_total_albums\fP (\fBsp_search\fP *search)"
.br
.ti -1c
.RI "int \fBsp_search_total_artists\fP (\fBsp_search\fP *search)"
.br
.ti -1c
.RI "int \fBsp_search_total_playlists\fP (\fBsp_search\fP *search)"
.br
.ti -1c
.RI "void \fBsp_search_add_ref\fP (\fBsp_search\fP *search)"
.br
.ti -1c
.RI "void \fBsp_search_release\fP (\fBsp_search\fP *search)"
.br
.in -1c
.SH "Typedef Documentation"
.PP 
.SS "typedef void \fBsearch_complete_cb\fP(\fBsp_search\fP *result, void *userdata)"
The type of a callback used in \fBsp_search_create()\fP
.PP
When this callback is called, the \fBsp_track_is_loaded()\fP, \fBsp_album_is_loaded()\fP, and \fBsp_artist_is_loaded()\fP functions will return non-zero for the objects contained in the search result\&.
.PP
\fBParameters:\fP
.RS 4
\fIresult\fP The same pointer returned by \fBsp_search_create()\fP 
.br
\fIuserdata\fP The opaque pointer given to \fBsp_search_create()\fP 
.RE
.PP

.SH "Function Documentation"
.PP 
.SS "void \fBsp_search_add_ref\fP (\fBsp_search\fP *search)"
Increase the reference count of a search result
.PP
\fBParameters:\fP
.RS 4
\fIsearch\fP The search result object 
.RE
.PP

.SS "\fBsp_album\fP* \fBsp_search_album\fP (\fBsp_search\fP *search, intindex)"
Return the album at the given index in the given search object
.PP
\fBParameters:\fP
.RS 4
\fIsearch\fP Search object 
.br
\fIindex\fP Index of the wanted album\&. Should be in the interval [0, \fBsp_search_num_albums()\fP - 1]
.RE
.PP
\fBReturns:\fP
.RS 4
The album at the given index in the given search object 
.RE
.PP

.PP
\fBExamples: \fP
.in +1c
\fBsearch\&.c\fP\&.
.SS "\fBsp_artist\fP* \fBsp_search_artist\fP (\fBsp_search\fP *search, intindex)"
Return the artist at the given index in the given search object
.PP
\fBParameters:\fP
.RS 4
\fIsearch\fP Search object 
.br
\fIindex\fP Index of the wanted artist\&. Should be in the interval [0, \fBsp_search_num_artists()\fP - 1]
.RE
.PP
\fBReturns:\fP
.RS 4
The artist at the given index in the given search object 
.RE
.PP

.PP
\fBExamples: \fP
.in +1c
\fBsearch\&.c\fP\&.
.SS "\fBsp_search\fP* \fBsp_search_create\fP (\fBsp_session\fP *session, const char *query, inttrack_offset, inttrack_count, intalbum_offset, intalbum_count, intartist_offset, intartist_count, intplaylist_offset, intplaylist_count, \fBsp_search_type\fPsearch_type, \fBsearch_complete_cb\fP *callback, void *userdata)"
Create a search object from the given query
.PP
\fBParameters:\fP
.RS 4
\fIsession\fP Session 
.br
\fIquery\fP Query search string, e\&.g\&. 'The Rolling Stones' or 'album:'The Black Album'' 
.br
\fItrack_offset\fP The offset among the tracks of the result 
.br
\fItrack_count\fP The number of tracks to ask for 
.br
\fIalbum_offset\fP The offset among the albums of the result 
.br
\fIalbum_count\fP The number of albums to ask for 
.br
\fIartist_offset\fP The offset among the artists of the result 
.br
\fIartist_count\fP The number of artists to ask for 
.br
\fIplaylist_offset\fP The offset among the playlists of the result 
.br
\fIplaylist_count\fP The number of playlists to ask for 
.br
\fIsearch_type\fP Type of search, can be used for suggest searches 
.br
\fIcallback\fP Callback that will be called once the search operation is complete\&. Pass NULL if you are not interested in this event\&. 
.br
\fIuserdata\fP Opaque pointer passed to \fCcallback\fP 
.RE
.PP
\fBReturns:\fP
.RS 4
Pointer to a search object\&. To free the object, use \fBsp_search_release()\fP 
.RE
.PP

.PP
\fBExamples: \fP
.in +1c
\fBsearch\&.c\fP\&.
.SS "const char* \fBsp_search_did_you_mean\fP (\fBsp_search\fP *search)"
Return the 'Did you mean' query for the given search object
.PP
\fBParameters:\fP
.RS 4
\fIsearch\fP Search object
.RE
.PP
\fBReturns:\fP
.RS 4
The 'Did you mean' query for the given search object, or the empty string if no such info is available 
.RE
.PP

.PP
\fBExamples: \fP
.in +1c
\fBsearch\&.c\fP\&.
.SS "\fBsp_error\fP \fBsp_search_error\fP (\fBsp_search\fP *search)"
Check if search returned an error code\&.
.PP
\fBParameters:\fP
.RS 4
\fIsearch\fP Search object
.RE
.PP
\fBReturns:\fP
.RS 4
One of the following errors, from \fBsp_error\fP SP_ERROR_OK SP_ERROR_IS_LOADING SP_ERROR_OTHER_PERMANENT SP_ERROR_OTHER_TRANSIENT 
.RE
.PP

.PP
\fBExamples: \fP
.in +1c
\fBsearch\&.c\fP\&.
.SS "bool \fBsp_search_is_loaded\fP (\fBsp_search\fP *search)"
Get load status for the specified search\&. Before it is loaded, it will behave as an empty search result\&.
.PP
\fBParameters:\fP
.RS 4
\fIsearch\fP Search object
.RE
.PP
\fBReturns:\fP
.RS 4
True if search is loaded, otherwise false 
.RE
.PP

.SS "int \fBsp_search_num_albums\fP (\fBsp_search\fP *search)"
Get the number of albums for the specified search
.PP
\fBParameters:\fP
.RS 4
\fIsearch\fP Search object
.RE
.PP
\fBReturns:\fP
.RS 4
The number of albums for the specified search 
.RE
.PP

.PP
\fBExamples: \fP
.in +1c
\fBsearch\&.c\fP\&.
.SS "int \fBsp_search_num_artists\fP (\fBsp_search\fP *search)"
Get the number of artists for the specified search
.PP
\fBParameters:\fP
.RS 4
\fIsearch\fP Search object
.RE
.PP
\fBReturns:\fP
.RS 4
The number of artists for the specified search 
.RE
.PP

.PP
\fBExamples: \fP
.in +1c
\fBsearch\&.c\fP\&.
.SS "int \fBsp_search_num_playlists\fP (\fBsp_search\fP *search)"
Get the number of playlists for the specified search
.PP
\fBParameters:\fP
.RS 4
\fIsearch\fP Search object
.RE
.PP
\fBReturns:\fP
.RS 4
The number of playlists for the specified search 
.RE
.PP

.SS "int \fBsp_search_num_tracks\fP (\fBsp_search\fP *search)"
Get the number of tracks for the specified search
.PP
\fBParameters:\fP
.RS 4
\fIsearch\fP Search object
.RE
.PP
\fBReturns:\fP
.RS 4
The number of tracks for the specified search 
.RE
.PP

.PP
\fBExamples: \fP
.in +1c
\fBsearch\&.c\fP\&.
.SS "const char* \fBsp_search_playlist_image_uri\fP (\fBsp_search\fP *search, intindex)"
Return the image_uri of a playlist at the given index in the given search object
.PP
\fBParameters:\fP
.RS 4
\fIsearch\fP Search object 
.br
\fIindex\fP Index of the wanted playlist\&. Should be in the interval [0, \fBsp_search_num_playlists()\fP - 1]
.RE
.PP
\fBReturns:\fP
.RS 4
The playlist image_uri at the given index in the given search object 
.RE
.PP

.SS "const char* \fBsp_search_playlist_name\fP (\fBsp_search\fP *search, intindex)"
Return the playlist at the given index in the given search object
.PP
\fBParameters:\fP
.RS 4
\fIsearch\fP Search object 
.br
\fIindex\fP Index of the wanted playlist\&. Should be in the interval [0, \fBsp_search_num_playlists()\fP - 1]
.RE
.PP
\fBReturns:\fP
.RS 4
The playlist name at the given index in the given search object 
.RE
.PP

.SS "const char* \fBsp_search_playlist_uri\fP (\fBsp_search\fP *search, intindex)"
Return the uri of a playlist at the given index in the given search object
.PP
\fBParameters:\fP
.RS 4
\fIsearch\fP Search object 
.br
\fIindex\fP Index of the wanted playlist\&. Should be in the interval [0, \fBsp_search_num_playlists()\fP - 1]
.RE
.PP
\fBReturns:\fP
.RS 4
The playlist uri at the given index in the given search object 
.RE
.PP

.SS "const char* \fBsp_search_query\fP (\fBsp_search\fP *search)"
Return the search query for the given search object
.PP
\fBParameters:\fP
.RS 4
\fIsearch\fP Search object
.RE
.PP
\fBReturns:\fP
.RS 4
The search query for the given search object 
.RE
.PP

.PP
\fBExamples: \fP
.in +1c
\fBsearch\&.c\fP\&.
.SS "void \fBsp_search_release\fP (\fBsp_search\fP *search)"
Decrease the reference count of a search result
.PP
\fBParameters:\fP
.RS 4
\fIsearch\fP The search result object 
.RE
.PP

.PP
\fBExamples: \fP
.in +1c
\fBsearch\&.c\fP\&.
.SS "int \fBsp_search_total_albums\fP (\fBsp_search\fP *search)"
Return the total number of albums for the search query - regardless of the interval requested at creation\&. If this value is larger than the interval specified at creation of the search object, more search results are available\&. To fetch these, create a new search object with a new interval\&.
.PP
\fBParameters:\fP
.RS 4
\fIsearch\fP Search object
.RE
.PP
\fBReturns:\fP
.RS 4
The total number of albums matching the original query 
.RE
.PP

.SS "int \fBsp_search_total_artists\fP (\fBsp_search\fP *search)"
Return the total number of artists for the search query - regardless of the interval requested at creation\&. If this value is larger than the interval specified at creation of the search object, more search results are available\&. To fetch these, create a new search object with a new interval\&.
.PP
\fBParameters:\fP
.RS 4
\fIsearch\fP Search object
.RE
.PP
\fBReturns:\fP
.RS 4
The total number of artists matching the original query 
.RE
.PP

.SS "int \fBsp_search_total_playlists\fP (\fBsp_search\fP *search)"
Return the total number of playlists for the search query - regardless of the interval requested at creation\&. If this value is larger than the interval specified at creation of the search object, more search results are available\&. To fetch these, create a new search object with a new interval\&.
.PP
\fBParameters:\fP
.RS 4
\fIsearch\fP Search object
.RE
.PP
\fBReturns:\fP
.RS 4
The total number of playlists matching the original query 
.RE
.PP

.SS "int \fBsp_search_total_tracks\fP (\fBsp_search\fP *search)"
Return the total number of tracks for the search query - regardless of the interval requested at creation\&. If this value is larger than the interval specified at creation of the search object, more search results are available\&. To fetch these, create a new search object with a new interval\&.
.PP
\fBParameters:\fP
.RS 4
\fIsearch\fP Search object
.RE
.PP
\fBReturns:\fP
.RS 4
The total number of tracks matching the original query 
.RE
.PP

.PP
\fBExamples: \fP
.in +1c
\fBsearch\&.c\fP\&.
.SS "\fBsp_track\fP* \fBsp_search_track\fP (\fBsp_search\fP *search, intindex)"
Return the track at the given index in the given search object
.PP
\fBParameters:\fP
.RS 4
\fIsearch\fP Search object 
.br
\fIindex\fP Index of the wanted track\&. Should be in the interval [0, \fBsp_search_num_tracks()\fP - 1]
.RE
.PP
\fBReturns:\fP
.RS 4
The track at the given index in the given search object 
.RE
.PP

.PP
\fBExamples: \fP
.in +1c
\fBsearch\&.c\fP\&.
.SH "Author"
.PP 
Generated automatically by Doxygen for libspotify from the source code\&.
